﻿@model List<XukaShop.Models.Entities.Brand>

<table id="brandProductTable" class="table table-striped table-bordered responsive">
    <thead class="">
        <tr>
            <th class="center">#</th>
            <th>Tên nhãn hàng</th>
            <th>Chức năng</th>
        </tr>
    </thead>
    <tbody>
        @foreach (var brand in Model)
        {
            var index = Model.IndexOf(brand) + 1;
            <tr>
                <td class="center">
                    @index
                </td>
                <td>
                    @brand.BrandName
                </td>
                <td class="table-action">
                    <a href="@Url.Action("BrandDetail", "Brand", new { brandId = brand.Id })" data-toggle="tooltip" title="" class="tooltips" data-original-title="Sửa"><i class="fa fa-pencil"></i></a>
                    <a href="#" data-toggle="tooltip" title="" class="delete-row tooltips" data-original-title="Xóa"><i class="fa fa-trash-o" onclick="deleteBrand(@brand.Id)"></i></a>
                </td>
            </tr>
        }
    </tbody>
</table>
<script>
    jQuery(document).ready(function () {
        jQuery('#brandProductTable').DataTable({
            responsive: true
        });
    });

    function reloadTable() {
        $.ajax({
            url: "@Url.Action("ReloadTableBrand", "Brand")",
            type: "POST",
            success: function (result) {
                $('#lstBrandProduct').html(result);
            }
        });
    }
</script>
